<?php

class User extends CActiveRecord
{
	/**
	 * The followings are the available columns in table 'yii_users':
	 * @var integer $id
	 * @var string $contract
	 * @var string $account
	 * @var string $ip_address
	 * @var string $username
	 * @var string $balance
	 * @var string $abonplata
	 * @var string $limit
	 * @var string $end_time
	 * @var string $pkt_end_time
	 * @var integer $packet_id
	 * @var integer $speed_id
	 * @var integer $blocked
	 * @var integer $blocked_by_bill
	 * @var integer $enabled
	 * @var string $address
	 * @var string $email
	 * @var string $telephon
	 * @var integer $active
	 * @var string $change_time
	 */

	/**
	 * Returns the static model of the specified AR class.
	 * @return CActiveRecord the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'yii_users';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('contract, account, ip_address, change_time', 'required'),
			array('packet_id, speed_id, blocked, blocked_by_bill, enabled, active', 'numerical', 'integerOnly'=>true),
			array('contract, account', 'length', 'max'=>10),
			array('ip_address', 'length', 'max'=>15),
			array('username', 'length', 'max'=>50),
			array('balance, abonplata, limit', 'length', 'max'=>12),
			array('address', 'length', 'max'=>128),
			array('email, telephon', 'length', 'max'=>60),
			array('end_time, pkt_end_time', 'safe'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'Id',
			'contract' => 'Contract',
			'account' => 'Account',
			'ip_address' => 'Ip Address',
			'username' => 'Username',
			'balance' => 'Balance',
			'abonplata' => 'Abonplata',
			'limit' => 'Limit',
			'end_time' => 'End Time',
			'pkt_end_time' => 'Pkt End Time',
			'packet_id' => 'Packet',
			'speed_id' => 'Speed',
			'blocked' => 'Blocked',
			'blocked_by_bill' => 'Blocked By Bill',
			'enabled' => 'Enabled',
			'address' => 'Address',
			'email' => 'Email',
			'telephon' => 'Telephon',
			'active' => 'Active',
			'change_time' => 'Change Time',
		);
	}
}